.ub-banner {
    width: 100%;
    overflow: hidden;

    --swiper-navigation-size: 20px;

    &.container {
        .swiper-slide {
            .cover {
                max-width: var(--container-width);
                margin: 0 auto;
            }
        }
    }

    .swiper-slide {
        display: block;

        .cover {
            background-repeat: no-repeat;
            background-size: cover;
            background-color: transparent;
            background-position: center;
            overflow: hidden;
            display: block;
            position: relative;

            &:after {
                content: '';
                display: block;
                margin-top: 50%;
            }
        }

        &.a {
            .cover {
                display: flex;
                align-content: center;
                align-items: center;

                .content {
                    max-width: var(--container-width);
                    display: block;
                    margin: 1.5rem auto;
                    line-height: 2em;
                    flex-grow: 1;
                    padding: 0 2rem;

                    &.reverse {
                        .title {
                            color: #FFF;
                        }

                        .slogan {
                            color: #FFF;
                        }

                        .link {
                            border-color: #FFF;
                            color: #FFF;
                            background: transparent;
                        }

                        .text {
                            color: #FFF;
                        }
                    }

                    .title {
                        font-size: 2rem;
                        font-weight: bold;
                        color: var(--color-text);
                        line-height: 2rem;
                    }

                    .slogan {
                        margin-top: 1rem;
                        padding: 0.5rem 0;
                        font-size: 1rem;
                        color: var(--color-text);

                        .line {
                            font-size: 1rem;
                        }
                    }

                    .link {
                        padding: 0 1rem;
                        display: inline-block;
                        line-height: 2rem;
                        border-radius: 2rem;
                        background: var(--color-primary);
                        font-size: var(--font-size);
                        color: #FFF;
                        border: 0.1rem solid var(--color-primary);
                        letter-spacing: 0.1rem;
                        margin-top: 1rem;


                        &.sm {
                            font-size: var(--font-size-small);
                            line-height: 1.2rem;
                            border-width: 1px;
                            letter-spacing: 0;
                            padding: 0 0.5rem;
                            background: #FFF;
                            color: var(--color-primary);
                        }
                    }


                    .text {
                        padding-top: 1rem;
                    }

                }
            }
        }

        &.b {
            .cover {
                display: flex;

                .content {
                    max-width: var(--container-width);
                    display: flex;
                    flex-grow: 1;
                    margin: 0 auto;

                    .left {
                        flex-shrink: 0;
                        width: 50%;
                        display: flex;
                        flex-direction: column;
                        justify-content: center;
                        padding-left: 2rem;
                        box-sizing: border-box;

                        .title {
                            font-size: 2rem;
                        }

                        .slogan {
                            margin-top: 1rem;
                            padding: 0.5rem 0;
                            font-size: 1rem;
                        }

                        .link {
                            margin-top: 1rem;

                            .action {
                                padding: 0 1rem;
                                display: inline-block;
                                line-height: 2rem;
                                border-radius: 2rem;
                                background: var(--color-primary);
                                font-size: var(--font-size);
                                color: #FFF;
                                border: 0.1rem solid var(--color-primary);
                                letter-spacing: 0.1rem;
                                margin-bottom: 0.5rem;

                                &.sm {
                                    font-size: var(--font-size-small);
                                    line-height: 1.2rem;
                                    border-width: 1px;
                                    letter-spacing: 0;
                                    padding: 0 0.5rem;
                                    background: #FFF;
                                    color: var(--color-primary);
                                }
                            }
                        }

                        .text {
                            margin-top: 1rem;
                        }
                    }

                    .right {
                        flex-shrink: 0;
                        width: 50%;
                        display: flex;
                        flex-direction: column;
                        justify-content: center;

                        .image {
                            background-size: contain;
                            background-repeat: no-repeat;
                            background-position: center;
                            width: 80%;
                            margin: 0 auto;

                            &:after {
                                content: '';
                                display: block;
                                margin-top: 100%;
                            }
                        }
                    }
                }
            }
        }

        &.video {
            .cover {
                .video-player {
                    width: 100%;
                    height: 100%;
                    object-fit: cover;
                    position: absolute;
                    top: 0;
                    left: 0;
                }
            }
        }
    }

    &:hover {
        .swiper-button-white {
            opacity: 0.5;
        }
    }

    .swiper-button-white {
        opacity: 0;
        background: #FFF;
        color: var(--color-text);
        font-size: 10px;
        width: 2.5rem;
        height: 2.5rem;
        border-radius: 50%;
        margin-top: -1.25rem;
        transition: opacity 0.3s ease-in-out;
    }

    .swiper-pagination-bullet {
        box-shadow: #666 0 0 0.25rem;
        width: 16px;
        height: 4px;
        border-radius: 4px;

        &.swiper-pagination-bullet-active {
            box-shadow: none;
        }
    }

    .swiper-pagination {
        .swiper-pagination-bullet-active {
            background: var(--color-primary);
        }
    }

    &.ratio-1-1 {
        .swiper-slide {
            .cover:after {
                margin-top: 100%;
            }
        }
    }

    &.ratio-3-2 {
        .swiper-slide {
            .cover:after {
                margin-top: 66.66%;
            }
        }
    }

    &.ratio-4-3 {
        .swiper-slide {
            .cover:after {
                margin-top: 75%;
            }
        }
    }

    &.ratio-2-1 {
        .swiper-slide {
            .cover:after {
                margin-top: 50%;
            }
        }
    }

    &.ratio-1-1 {
        .swiper-slide {
            .cover:after {
                margin-top: 100%;
            }
        }
    }

    &.ratio-3-1 {
        .swiper-slide {
            .cover:after {
                margin-top: 33.33%;
            }
        }
    }

    &.ratio-4-1 {
        .swiper-slide {
            .cover:after {
                margin-top: 25%;
            }
        }
    }

    &.ratio-5-1 {
        .swiper-slide {
            .cover:after {
                margin-top: 20%;
            }
        }
    }

    &.ratio-5-2 {
        .swiper-slide {
            .cover:after {
                margin-top: 40%;
            }
        }
    }

    &.ratio-5-3 {
        .swiper-slide {
            .cover:after {
                margin-top: 60%;
            }
        }
    }

    &.ratio-10-1 {
        .swiper-slide {
            .cover:after {
                margin-top: 10%;
            }
        }
    }
}

@media screen and (max-width: 40rem) {
    .ub-banner {

        &.m-ratio-1-2 {
            .swiper-slide {
                .cover:after {
                    margin-top: 200%;
                }
            }
        }

        &.m-ratio-1-1 {
            .swiper-slide {
                .cover:after {
                    margin-top: 100%;
                }
            }
        }

        &.m-ratio-3-2 {
            .swiper-slide {
                .cover:after {
                    margin-top: 66.66%;
                }
            }
        }

        &.m-ratio-4-3 {
            .swiper-slide {
                .cover:after {
                    margin-top: 75%;
                }
            }
        }

        &.m-ratio-2-1 {
            .swiper-slide {
                .cover:after {
                    margin-top: 50%;
                }
            }
        }

        &.m-ratio-1-1 {
            .swiper-slide {
                .cover:after {
                    margin-top: 100%;
                }
            }
        }

        &.m-ratio-3-1 {
            .swiper-slide {
                .cover:after {
                    margin-top: 33.33%;
                }
            }
        }

        &.m-ratio-4-1 {
            .swiper-slide {
                .cover:after {
                    margin-top: 25%;
                }
            }
        }

        &.m-ratio-5-1 {
            .swiper-slide {
                .cover:after {
                    margin-top: 20%;
                }
            }
        }

        &.m-ratio-5-2 {
            .swiper-slide {
                .cover:after {
                    margin-top: 40%;
                }
            }
        }

        &.m-ratio-5-3 {
            .swiper-slide {
                .cover:after {
                    margin-top: 60%;
                }
            }
        }

        &.m-ratio-10-1 {
            .swiper-slide {
                .cover:after {
                    margin-top: 10%;
                }
            }
        }

        .swiper-button-next, .swiper-button-prev {
            display: none;
        }

        .swiper-slide {
            &.a {
                .cover {
                    .content {
                        padding: 1rem;
                        text-align: center;
                        position: absolute;
                        top: 0;
                        left: 0;
                        right: 0;
                        border: 0;
                        margin: 0;
                        height: calc(100% - 50px);
                        display: flex;
                        flex-direction: column;
                        justify-content: center;
                        align-items: center;

                        .title {
                            font-size: 1.2rem;
                        }

                        .slogan {
                            padding: 0.5rem 0;
                        }

                        .link {
                            line-height: 1.5rem;
                            height: 1.5rem;
                        }
                    }
                }
            }

            &.b {
                .cover {
                    .content {
                        flex-direction: column;

                        .left {
                            width: 100%;
                            height: 50%;
                            text-align: center;
                            padding-left: 0;
                        }

                        .right {
                            width: 100%;
                            height: 50%;
                            margin-top: 1rem;
                        }
                    }
                }
            }
        }
    }
}

